﻿using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Configuration;
using System.Collections.Generic;

namespace Wicresoft.EKA.NRemedy.Test
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            string ARServer = ConfigurationManager.AppSettings["ARServer"];
            string ARUid = ConfigurationManager.AppSettings["ARUid"];
            string ARPwd = ConfigurationManager.AppSettings["ARPwd"];

            GlobalSettings.SetCharacterEncoding("UTF8");    //GlobalSetting 里面 
            ARLoginContext context = new ARLoginContext(ARServer, ARUid, ARPwd);
            ARProxy<UserModel> ar = new ARProxy<UserModel>(context);

            string requestID = "000000000000001";
            string querystr = string.Format("\'Request ID\'=\"{0}\"", requestID);
            UserModel u = ar.GetListEntry(querystr, new List<uint>() {1}).FirstOrDefault();

            Assert.AreEqual<string>(requestID, u.RequestID);

        }
    }
}
